//Copyright 2012 Trevin Liberty
//GNU GPL v3
//Author: Trevin Liberty
//
//Used to draw gui information to the screen and
//determine if a gui button is pressed.

#ifndef GUI_H
#define GUI_H

#include <allegro5\allegro.h>
#include <allegro5\allegro_font.h>
#include <list>

#include "Point.h"
#include "Doohickeys\Entity.h"

using std::list;

//Used to return upon a button press
enum Build {null, axe, bow};

//See comment at top of file for a complete description
class GUI {
private:
	Point<int> sideBarPos;

	int screenWidth;
	int screenHeight;

	Point<int> mapBounds;
	Point<int> sideBarBounds;

	bool barracksSelected;

	ALLEGRO_BITMAP* miniMap;
	ALLEGRO_BITMAP* sideBar;
	ALLEGRO_BITMAP* scoreBoard;

	ALLEGRO_FONT* font;

public:
	//Constructor
	//	PARAMS:
	//int screenWidth: The width of the system window.
	//int screenHeight: The height of the system window.
	GUI(int screenWidth, int screenHeight);

	//Used when the screen changes size.
	//	PARAMS:
	//int width: New screen width.
	//int height: New screen height.
	void changeScreenDimensions(int width, int height) {screenWidth = width, screenHeight = height;}

	//Returns a Build type of, "axe" or "bow" if cursorXY is within a button's bounds.
	//	else returns null.
	//SEE: GUI.h->enum Build
	//	PARAMS:
	//Point<int> cursorXY: The position the cursor.
	Build getNewButtonPressBuilding(Point<int> cursorXY);

	//Sets whether the Barracks is selected or not. Used to display building options.
	void setBarracksSelected(bool t) {barracksSelected = t;}

	//Draws all GUI elements.
	//	PARAMS:
	//list<Entity*>* entities: List of all Entities. Used to draw points on the minimap
	//Point<float> camPos: Position of the camera. Used to draw visible rectangle on minimap
	//PlayerResources* playerRes: Used to display the player's stats. SEE: GameWorld.h->Struct PlayerResources
	void draw(list<Entity*>* entities, Point<float> camPos, PlayerResources* playerRes);

};

#endif